{template 'common/header'}
<div class="main">
    <form class="form-horizontal form" id="setting-form" action=""
          method="post">
        <div class="panel panel-default">
            <div class="panel-heading">配置中心</div>
            <div class="panel-body">
                <!-- title-->
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">标题设置</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" name="data[game_title]"
                               value="{$settings['game_title']}" />
                        <span class="help-block">游戏标题设置</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">分享标题</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" name="data[share_title]"
                               value="{$settings['share_title']}" />
                        <span class="help-block">分享标题</span>
                    </div>
                </div>
                <!-- logo -->
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">logo</label>
                    <div class="col-sm-8">
                        {php echo tpl_form_field_image('data[logo]', $settings['logo'])}
                        <span class="help-block">游戏成功之后的logo展示</span>
                    </div>
                </div>
                <!-- pic-->
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">分享图片</label>
                    <div class="col-sm-8">
                        {php echo tpl_form_field_image('data[share_pic]', $settings['share_pic'])}
                        <span class="help-block">分享图片</span>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="form-group col-sm-12">
            <input name="token" type="hidden" value="{$_W['token']}" /> <input
                type="submit" class="btn btn-primary col-lg-1" name="submit"
                value="提交" />
        </div>
    </form>
</div>
<script type="text/javascript">
    require([ 'jquery', 'util' ], function($, util) {
        $(function() {
            $("#setting-form").submit(function() {
                if ($("input[name='data[title]']").val().trim() == "") {
                    util.message("未填写标题！");
                    return false;
                }
            });
        });
    });
</script>
{template 'common/footer'}
